package titleToNumber;

public class Solution {
    public int titleToNumber(String columnTitle) {
        // 26 进制转10 进驻
        int ans = 0;
        for (int i = 0; i < columnTitle.length(); i++) {
            ans = ans*26 + columnTitle.charAt(i) - 'A'+1;
        }
        return ans;
    }
}
